package service.impl;

import java.util.List;
import dao.MessageDAO;
import dao.impl.MessageDaoImpl;
import entity.Message;
import service.MessageService;

public class MessageServiceImpl implements MessageService{
	private MessageDAO dao;
	
	public MessageServiceImpl(){
		this.dao = new MessageDaoImpl();
	}

	@Override
	public List<Message> getMessageByReceiveUname(String uname) {
		return dao.getMessageByReceiveUname(uname);
	}
	
	@Override
	public Message getMessageByMid(int mid) {
		return dao.getMessageByMid(mid);
	}

	@Override
	public int deleteMessageById(String id) {
		return dao.deleteMessageById(id);
	}

	@Override
	public void sendMessage(Message m) {
		dao.sendMessage(m);
	}

	@Override
	public boolean updateMessage(int mid) {
		return dao.updateMessage(mid);
	}

}
